package com.oo.polymorphic_4.house;

/**
 * Villa--${description}
 *
 * @author: Jovi
 * @createTime: 2017-05-09 17:53
 **/
public class Villa extends House {
    private int gardenNum;

    public Villa() {
    }

    public Villa(String name, int price, String address, int area, int gardenNum) {
        super(name, price, address, area);
        this.gardenNum = gardenNum;
    }

    @Override
    public void buy() {
        System.out.println("名称："+this.getName()+"\n价格："
        +this.getPrice()+"万元\n位置："
        +this.getAddress()+"\n面积："
        +this.getArea()+"平米\n拥有花园："
        +this.getGardenNum()+"个");
    }

    public int getGardenNum() {
        return gardenNum;
    }

    public void setGardenNum(int gardenNum) {
        this.gardenNum = gardenNum;
    }
}
